<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理员注册</title>
    <script type="text/javascript" src="../js/jquery-3.3.1.min.js"></script>
</head>
<body>
<form id="form">
账号：<input type="text" name="eaName" id="eaName"><span id="msg"></span><br>
密码：<input type="password" name="eaPassword" id="eaPassword"><br>
<input type="button" value="注册" id="btn" onclick="oder()">
</form>
<script language="JavaScript">
    $(function () {
        $("#btn").click(function () {
            $.ajax({
                type:"POST",
                url:"../AdminRegServlet",
                data:{
                    eaName: $("#eaName").val(),
                    eaPassword: $("#eaPassword").val()
                },
                success:function (data) {
                    if (data){
                        location.href="http://localhost:8080/manage/index.html";
                    }
                    else {
                        alert(data.message)
                    }
                }
            })
        })
    })
</script>
</body>

</html>